//
import Mock from 'mockjs'

// 用户登录
const { Login } = Mock.mock({
  Login: {
    token: 'dhbsfdsfhsdjhbsdhfbsefdf'
  }
})
Mock.mock('tets/mock/271020/api/userLogin', 'post', () => {
  return {
    code: 20000,
    data: Login,
    message: '登录成功'
  }
})

// 获取用户信息
const { Userinfos } = Mock.mock({
  Userinfos: {
    name: 'admin',
    avatar: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif?imageView2/1/w/80/h/80',
    roles: ['admin']// ['admin'] or ,['developer','editor']
  }
})
Mock.mock('tets/mock/271020/api/getUserInfos', 'post', () => {
  return {
    code: 20000,
    data: Userinfos,
    message: '获取用户信息成功'
  }
})

// logout
Mock.mock('tets/mock/271020/api/userLogout', 'post', () => {
  return {
    code: 20000,
    // data: logout,
    message: '退出成功'
  }
})

